package main.java.org.example;

import java.awt.*;

public abstract class GameObject {
    protected int x, y, size;
    protected Color color;

    public GameObject(int x, int y, int size, Color color) {
        this.x = x;
        this.y = y;
        this.size = size;
        this.color = color;
    }

    // 绘制游戏对象
    public abstract void draw(Graphics g);

    // 获取游戏对象X坐标
    public int getX() {
        return x;
    }

    // 获取游戏对象Y坐标
    public int getY() {
        return y;
    }

    // 获取游戏对象大小
    public int getSize() {
        return size;
    }
}

